import '../item_style.dart';
import '../tooltip.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'boxplot_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class BoxPlotEmphasis {
  var focus;
  var blurScope;
  ItemStyle? itemStyle;

  BoxPlotEmphasis({this.focus, this.blurScope, this.itemStyle});

  factory BoxPlotEmphasis.fromJson(Map<String, dynamic> json) =>
      _$BoxPlotEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$BoxPlotEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class BoxPlotBlurSelectEmphasis {
  ItemStyle? itemStyle;

  BoxPlotBlurSelectEmphasis({this.itemStyle});

  factory BoxPlotBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$BoxPlotBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$BoxPlotBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class BoxPlotData {
  var name;

  var value;
  ItemStyle? itemStyle;

  BoxPlotBlurSelectEmphasis? emphasis;
  BoxPlotBlurSelectEmphasis? blur;
  BoxPlotBlurSelectEmphasis? select;

  Tooltip? tooltip;

  BoxPlotData(
      {this.name,
      this.value,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select,
      this.tooltip});

  factory BoxPlotData.fromJson(Map<String, dynamic> json) =>
      _$BoxPlotDataFromJson(json);

  Map<String, dynamic> toJson() => _$BoxPlotDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class BoxPlotSeries {
  var type = 'boxplot';
  var id;
  var coordinateSystem;
  var xAxisIndex;
  var yAxisIndex;
  var name;

  var legendHoverLink;
  var hoverAnimation;
  var layout;
  var boxWidth;

  ItemStyle? itemStyle;

  BoxPlotEmphasis? emphasis;

  BoxPlotBlurSelectEmphasis? blur;
  BoxPlotBlurSelectEmphasis? select;

  var selectedMode;
  var dimensions;

  var encode;

  List<BoxPlotData>? data;
  MarkPoint? markPoint;
  MarkLine? markLine;
  MarkArea? markArea;

  var zlevel;
  var z;
  var silent;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  Tooltip? tooltip;

  BoxPlotSeries(
      {this.id,
      this.coordinateSystem,
      this.xAxisIndex,
      this.yAxisIndex,
      this.name,
      this.legendHoverLink,
      this.hoverAnimation,
      this.layout,
      this.boxWidth,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select,
      this.selectedMode,
      this.dimensions,
      this.encode,
      this.data,
      this.markPoint,
      this.markLine,
      this.markArea,
      this.zlevel,
      this.z,
      this.silent,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.tooltip});

  factory BoxPlotSeries.fromJson(Map<String, dynamic> json) =>
      _$BoxPlotSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$BoxPlotSeriesToJson(this);
}
